package com.jxpowernode.bitcon.controllers;
import com.jxpowernode.bitcon.bean.douyin.FoodVideo;
import com.jxpowernode.bitcon.bean.douyin.GameVideo;
import com.jxpowernode.bitcon.bean.douyin.HotVideo;
import com.jxpowernode.bitcon.douyin.DouYinController;
import com.jxpowernode.bitcon.service.douyinservice.FoodVideoService;
import com.jxpowernode.bitcon.service.douyinservice.HotVideoService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: Lixuewei
 * @Email:1410511702@qq.com
 * @Desc:
 * @Date: 2021/12/16 21:06
 */
public  class DouYiAllController extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        resp.setContentType("text/html;charset=UTF-8");
        req.setCharacterEncoding("UTF-8");
        String douyin = req.getParameter("douyin");
        System.out.println(douyin);
        System.out.println("食物达人".equals(douyin));
        FoodVideoService food = new FoodVideoService();
        List<FoodVideo> foodVideo = food.getFoodVideo();
        System.out.println(foodVideo);

        if("食物达人".equals(douyin)){
            req.setAttribute("food",foodVideo);
            req.getRequestDispatcher("/douyin.jsp").forward(req, resp);
        }



    }
}